
<%@ include file="/common/taglibs.jsp"%>
<!--分页查询共用的页面-->
<%@ include file="/common/common.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"%>

	
<script type="text/javascript" src="<%=jsPath%>/jquery/jquery.timers.js"></script><!--定时器-->
<script type="text/javascript" src="<%=jsPath%>/terminalCommand.js"></script><!--命令结果查询-->

<script>

	/*
	修改代码：
	1.新定义变量TerminalCommmand，为命令支持变量
	2.重定义id：
	原：null		现：tempTrackCommandmsg
	原：null		现：tempTrackBtn
	原：		现：
	*/

	var tc2TempTrack = new TerminalCommand2();
     var timerName = "tempTrackTimer";
	///////////////////////////////////////////////////////////////
$().ready(function() {
	tc2TempTrack.messageDiv = $("#tempTrackCommandmsg");
    tc2TempTrack.timerName = timerName;
	tc2TempTrack.commandButton = $("#tempTrackBtn");

	 $("#tempTrackEntityForm").validate(); //初始化验证信息

	 var defaultRoleId = "";//${roleId}; //取出当前车辆的车牌颜色，默认选中
	//ajax填充下拉框数据 填充监听类型 选项
	 $("#listenType").lookup({category:"ListenTerminal", selectedValue:defaultRoleId});
	
	 
	 Utility.ajaxSubmitForm("tempTrackEntityForm", {
						 success:function(responseText)
						 {
							   var result = responseText;
								if (result.success) {
									 var commandId = result.data; //下发成功后，获取到命令Id

									 tc2TempTrack.startQueryResult(commandId);//命令下发成功,根据命令id,开始尝试获取检索结果
								}
								else {
									$("#tempTrackCommandmsg").html("提交失败! 错误原因：" + (result.message ? result.message : result.Data));
									//停止所有的在$('body')上定时器  
									$('body').stopTime (timerName);  
								  }
						 }
	 });
});
</script>
 <BODY>
	<form id="tempTrackEntityForm" name="tempTrackEntityForm" 
			action='<%=ApplicationPath%>/tempTrack/send.action' method="POST">
				
        <input type="hidden"  name="vehicleId"  id="vehicleId" value="${vehicleId}"/>
  <table width="100%"  class="TableBlock">
					<tbody><tr>
						<td colspan="2" style="font-weight: bold; background: #EFEFEF;" height="25">位置跟踪信息
						<span style="color:red;background:blue;">${message}</span>
						</td>
					</tr>
					<tr>
						<td align="right">位置上报时间间隔(秒)
							:</td>
						<td>
						<input id="interval" name="interval" class="required digits"  value="10" maxlength="16" size="20" >
						</td>
					</tr>
					<tr>
						<td align="right">跟踪有效期(秒):</td>
						<td ><input id="timeSpan" name="timeSpan" class="required digits"  value="120" maxlength="16" size="20" >
						</td>
					</tr>

						<td colspan=2 align="center">
						   <input id="tempTrackBtn" type="submit" class="sendjson" value="发送">
						   <span id="tempTrackCommandmsg" class="commandMsg"></span></td>
						
					</tr>

				
					
				</tbody></table>
 </BODY>
</HTML>
